package zzh.com.kangkenuo.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

import zzh.com.kangkenuo.R;
import zzh.com.kangkenuo.utils.CountTimerUtlis;

/**
 * @author zzh
 * @Name:
 * @Description:
 * @date
 * @time
 * @copyright
 */
public class SplashActivity extends Activity {
    TextView iv_splash;
    private CountTimerUtlis countTimerUtlis;
    private long millisInFuture = 2000;
    private long countDownInterval = 1000;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        iv_splash = (TextView) findViewById(R.id.iv_splash);
        countTimerUtlis = new CountTimerUtlis(
                millisInFuture, countDownInterval, iv_splash, R.string.count_start, new CountTimerUtlis.Call() {
            @Override
            public void END() {
                Frist();
                countTimerUtlis.cancel();
            }
        });
        countTimerUtlis.start();
    }

    private void Frist() {
        startActivity(new Intent(SplashActivity.this, MainActivity.class));
        finish();
    }
}
